package com.neusoft.neuiotms.dcam.workflow.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@Entity
@Table(name = "neuiot_workorder_arrival_count")
@org.hibernate.annotations.Table(appliesTo = "neuiot_workorder_arrival_count", comment = "到货验收数量表")
public class ArrivalCount extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    @ManyToOne
    private ArrivalMain arrivalMain;

    /** 资产分类名 */
    @Length(max = 50, message = "固定资产分类名不能超过{max}位")
    @Column(length = 50)
    private String typeName;

    /** 资产分类编码 */
    @Length(max = 50, message = "固定资产分类编码不能超过{max}位")
    @Column(length = 50)
    private String typeCode;

    /** 产品名 */
    @Length(max = 50, message = "产品名不能超过{max}位")
    @Column(length = 50, nullable = true)
    private String productName;

    /** 规格型号 */
    @Length(max = 100, message = "规格型号不能超过{max}位")
    @Column(length = 100, nullable = true)
    private String specification;

    /** 原值 */
    @Column(length = 10, nullable = true)
    private Double money;

    @Column(nullable = false)
    @NotNull(message = "数量不能为空")
    private int count = 1;

    /** 单个资产价格 */
    @Column(nullable = false)
    @NotNull(message = "单个资产价格不能为空")
    private Double amount = 0.0D;

    /** 合同项描述 */
    @Column(nullable = true)
    @Length(max = 1023, message = "合同项描述不能超过{max}位")
    private String description;

    /** 合同项ID */
    @Column(nullable = false)
    private Long itemId;

}
